Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement YEAR function #1007

Merged
merged 10 commits into from
Aug 21, 2021
Merged

Implement YEAR function #1007

merged 10 commits into from
Aug 21, 2021

Conversation

stanim
Copy link
Contributor

@stanim stanim commented Aug 19, 2021

PR Details

Description

Returns the year corresponding to a date. The year is returned as an integer in the range 1900-9999.

Syntax

YEAR(serial_number)

The YEAR function syntax has the following arguments:

  • Serial_number Required. The date of the year you want to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008.

Related Issue

Fixes #1006
Important: pull request #1003 and #1005 must be merged first!

Motivation and Context

This helps with Excels from third party, where the YEAR function is frequently used.

How Has This Been Tested

Added tests to calc_test.go

Tested on:

  • OS: Archlinux 5.13.10-arch1-1
  • WPS Spreadsheets (version wps-office 11.1.0.10702-1)
  • LibreCalc (version libreoffice-fresh 7.1.5-2)

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2021

Codecov Report

Merging #1007 (e1066c8) into master (4d716fa) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1007   +/-   ##
=======================================
  Coverage   97.56%   97.56%           
=======================================
  Files          29       29           
  Lines       11411    11427   +16     
=======================================
+ Hits        11133    11149   +16     
  Misses        154      154           
  Partials      124      124           
Flag Coverage Δ
unittests 97.56% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
calc.go 98.03% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d716fa...e1066c8. Read the comment docs.

@xuri xuri added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 20, 2021
@xuri xuri merged commit 9b55f4f into qax-os:master Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement YEAR function
3 participants